import 'package:flutter/material.dart';
import 'package:mobile_app.core/core/presentation/theme/theme.dart';
import 'package:mobile_app.core/core/presentation/widgets/app_button.dart';

class PronunciationButton extends StatelessWidget {
  const PronunciationButton({
    required this.size,
    required this.onPressed,
    this.borderWidth = 0,
    this.borderColor = Colors.transparent,
    super.key,
  });

  final double size;
  final double borderWidth;
  final Color borderColor;
  final VoidCallback? onPressed;

  @override
  Widget build(BuildContext context) {
    final buttonEffectiveSize = size - borderWidth;
    return ClipOval(
      child: Container(
        color: borderColor,
        child: Padding(
          padding: EdgeInsets.all(borderWidth),
          child: AppButton(
            color: CoreTheme.of(context).primaryColor,
            disabledColor: CoreTheme.of(context).primaryColor,
            borderRadius: BorderRadius.circular(buttonEffectiveSize),
            onPressed: onPressed,
            child: SizedBox(
              width: buttonEffectiveSize,
              height: buttonEffectiveSize,
              child: Center(
                child: Icon(
                  Icons.volume_up_rounded,
                  color: CoreTheme.of(context).primaryContrastingColor,
                  size: buttonEffectiveSize / 1.5,
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
